package field

import "gitee.com/yanwc/net/utils"

type (
	FenceVersion    uint32  // 设备内置围栏版本号
	FenceVersionRaw [4]byte // 设备内置围栏版本号
)

func (fv FenceVersion) Raw() (out FenceVersionRaw) {
	copy(out[:], utils.NumberToBytesWithBigEndian(fv))
	return
}

func (fv FenceVersionRaw) Type() FenceVersion {
	return utils.BytesToNumber[FenceVersion](fv[:])
}

func (fv FenceVersionRaw) Slice() []byte {
	return fv[:]
}
